# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataMigration.V1.Model.ConversionWorkspace do
  @moduledoc """
  The main conversion workspace resource entity.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the workspace resource was created.
  *   `destination` (*type:* `GoogleApi.DataMigration.V1.Model.DatabaseEngineInfo.t`, *default:* `nil`) - Required. The destination engine details.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. The display name for the workspace.
  *   `globalSettings` (*type:* `map()`, *default:* `nil`) - Optional. A generic list of settings for the workspace. The settings are database pair dependant and can indicate default behavior for the mapping rules engine or turn on or off specific features. Such examples can be: convert_foreign_key_to_interleave=true, skip_triggers=false, ignore_non_table_synonyms=true
  *   `hasUncommittedChanges` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the workspace has uncommitted changes (changes which were made after the workspace was committed).
  *   `latestCommitId` (*type:* `String.t`, *default:* `nil`) - Output only. The latest commit ID.
  *   `latestCommitTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the workspace was committed.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Full name of the workspace resource, in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
  *   `source` (*type:* `GoogleApi.DataMigration.V1.Model.DatabaseEngineInfo.t`, *default:* `nil`) - Required. The source engine details.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the workspace resource was last updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :destination => GoogleApi.DataMigration.V1.Model.DatabaseEngineInfo.t() | nil,
          :displayName => String.t() | nil,
          :globalSettings => map() | nil,
          :hasUncommittedChanges => boolean() | nil,
          :latestCommitId => String.t() | nil,
          :latestCommitTime => DateTime.t() | nil,
          :name => String.t() | nil,
          :source => GoogleApi.DataMigration.V1.Model.DatabaseEngineInfo.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:destination, as: GoogleApi.DataMigration.V1.Model.DatabaseEngineInfo)
  field(:displayName)
  field(:globalSettings, type: :map)
  field(:hasUncommittedChanges)
  field(:latestCommitId)
  field(:latestCommitTime, as: DateTime)
  field(:name)
  field(:source, as: GoogleApi.DataMigration.V1.Model.DatabaseEngineInfo)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.DataMigration.V1.Model.ConversionWorkspace do
  def decode(value, options) do
    GoogleApi.DataMigration.V1.Model.ConversionWorkspace.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DataMigration.V1.Model.ConversionWorkspace do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
